﻿@model BookClubPortal.Models.Book

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset class="details-listing">
        <legend>Book</legend>

        @Html.HiddenFor(model => model.BookId)

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Author)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Author)
            @Html.ValidationMessageFor(model => model.Author)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ReleaseYear, "Release Year")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ReleaseYear)
            @Html.ValidationMessageFor(model => model.ReleaseYear)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description, "Description")
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description, new { style = "height: 150px; width:300px;" })
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ImageURL, "Image URL")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ImageURL)
            @Html.ValidationMessageFor(model => model.ImageURL)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.GenreId,"Genre")
        </div>
        <div class="editor-field">
            @Html.DropDownList("GenreId", String.Empty)
            @Html.ValidationMessageFor(model => model.GenreId)
        </div>

       
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
